﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace Wenkongyi
{
    [Designer(typeof(TongJi_EMS._TJ_Basic.TJ_BasicControlDesigner))]
    public partial class wenkongyi : TongJi_EMS._TJ_Basic.TJ_BasicControl//温控仪
    {
        public wenkongyi()
        {
            InitializeComponent();
            this.NeedPoint = true;
            this.NeedColorChange = false;
        }

        //private void wenkongyi_Load(object sender, EventArgs e)
        //{
        //    wenkongyi_Resize(sender, e);
        //    Zongbao.zongbao zb = new Zongbao.zongbao();
        //    if (zb.State == "0")
        //    {
        //        BackgroundImage = TongJi_EMS.Properties.Resources.温度计_关_;
        //    }
        //    else
        //    {
        //        BackgroundImage = TongJi_EMS.Properties.Resources.温度计_开_;
        //    }
        //}

        //private void wenkongyi_Paint(object sender, PaintEventArgs e)
        //{

        //    //    //wky_Alarm = true;
        //    //    if (wky_Alarm)
        //    //    {
        //    //        e.Graphics.FillRectangle(Brushes.Red, x * 0.5f, y * 0.5f, x , y * 0.8f);

        //    //    }
        //    //    else
        //    //    {
        //    //        e.Graphics.FillRectangle(Brushes.Green, x * 0.5f, y * 0.5f, x , y * 0.8f);
        //    //    }
        //    //    e.Graphics.FillRectangle(Brushes.DarkBlue, 0, 0, x * 2f, y * 0.5f);
        //    //    e.Graphics.FillRectangle(Brushes.DarkBlue, 0, 0, x * 0.5f, y * 2f);
        //    //    e.Graphics.FillRectangle(Brushes.DarkBlue, x * 1.5f, 0, x * 0.5f, y * 2f);
        //    //    e.Graphics.FillRectangle(Brushes.DarkBlue, 0, y*1.2f, x * 2f, y*1.2f);
        //}

        //private void wenkongyi_Resize(object sender, EventArgs e)
        //{
        //    this.x = this.Width / 2;
        //    this.y = this.Height / 2;
        //    Refresh();
        //}

        private void wenkongyi_BolChanged(TongJi_EMS._Event.TJBolChangeArgs e)
        {
            if (e.State == "0")
                this.BackgroundImage = TongJi_EMS.Properties.Resources.温度计_关_;
            else
                this.BackgroundImage = TongJi_EMS.Properties.Resources.温度计_开_;
            this.Refresh();
        }

    }
}